<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var str = '  hello world   '
        // var str = new String('hello world')

        console.log(str.length);

        console.log(str.charAt(0), str.charAt(str.length-1));

        console.log(str.indexOf('o'));

        console.log(str.lastIndexOf('o'));

        console.log(str.toUpperCase());

        console.log(str.toLowerCase());

        console.log(str.substring(1,4));

        console.log(str.substr(1,3));

        console.log(str.replace('o','x'));

        console.log(str.split(' '));

        console.log(str.trim());
    </script>
</head>
<body>

</body>
</html>